package com.erp.hr.base.dao.impl;

import com.erp.hr.base.dao.BaseDao;
import org.redragon.framework.hibernate.DaoSupport;
import org.redragon.framework.hibernate.model.Pages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 持久实现层基类
 * @Author: syz
 * @blame syz
 * @CreateTime: 2021/4/6
 */
@Repository
@Transactional
public abstract class BaseDaoImpl<T> implements BaseDao<T> {

    /**
     * dao支持
     */
    @Autowired
    private DaoSupport daoSupport;


    @Override
    public void insertDataObject(T t) {
        daoSupport.insertDataTransaction(t);
    }

    @Override
    public void updateDataObject(T t) {
        daoSupport.updateDataTransaction(t);
    }

    @Override
    public void insertOrUpdateDataObject(T t) {
        daoSupport.insertOrUpdateDataTransaction(t);
    }

    @Override
    public void deleteDataObject(T t) {}

    @Override
    public List<T> getDataObjects() {
        return null;
    }

    @Override
    public T getDataObject(int i) {
        return null;
    }

    @Override
    public List<T> getDataObjects(Pages pages) {
        return null;
    }

    @Override
    public List<T> getDataObjects(Pages pages, T t) {
        return null;
    }

    @Override
    public List<Map<String, Object>> getDataObjectsArray(Pages pages, T t) {
        return null;
    }

}